#pragma once


enum SendStatus { ST_GETCRYPT=0, ST_MAKECRYPTMSG, ST_MAKEMSG, ST_SENDMSG, ST_DONE };

class SendEntry {
	Host		*host;
	SendStatus	status;
	UINT		command;
	char		*msg;
	int			msgLen;

public:
	SendEntry() { msg = NULL; host = NULL; }
	~SendEntry() { delete [] msg; if (host && host->RefCnt(-1) == 0) delete host; }
	void SetMsg(char *_msg, int len) { msg = new char[msgLen=len]; memcpy(msg, _msg, len); }
	const char *Msg(void) { return msg; }
	int MsgLen() { return msgLen; }
	void SetHost(Host *_host) { (host = _host)->RefCnt(1); }
	Host *Host(void) { return host; }
	void SetStatus(SendStatus _status) { status = _status; }
	SendStatus Status(void) { return status; }
	void SetCommand(UINT _command) { command = _command ; }
	UINT Command(void) { return command; }
};
